package com.hongyun.tms.common.enums;

import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * 响应码枚举
 **/
@Getter
public enum BizCode {

    /**
     * 网关默认响应,成功
     **/
    SUCCESS(HttpStatus.OK.value(), "SUCCESS"),

    REQUIRED_PARAM_MISS(201, "缺失必填参数"),

    IN_ENUM_NOT_MATCH(202, "入参枚举不匹配"),

    FILE_TOO_LARGE(203, "文件上传大小超过限制"),

    FILE_FORMAT_ERROR(204, "不支持的文件上传格式"),
    FILE_NOT_EXIST(204, "该文件不存在"),

    FILE_NAME_TOO_LONG(205, "文件名过长"),

    CREW_ID_NOT_NULL(206, "船员ID不能为空"),
    PROD_ID_NOT_NULL(207, "生产计划ID不能为空"),
    TUG_ID_NOT_NULL(208, "拖轮ID不能为空"),


    //拖轮负责人————start
    START_NOT_MORE_THAN_END_TIME(209, "开始日期需小于截止日期"),
    EXIST_NULL_END_DATE(210, "结束日期为空已存在"),
    START_END_DATE_REPEAT(211, "起止日期重叠"),

    //拖轮负责人————end

    //船舶作业计划----start
    PLAN_NOT_EXIST(212, "作业计划不存在或已被删除"),

    //船舶作业计划----end


    //拖轮费率----start
    TUG_EXIST_SAME_LENGTH(212, "船长长度区间重合"),

    //拖轮费率----end


    //维修单----start
    REPAIR_BILL_NOT_EXIST(213, "该维修单不存在"),
    REPAIR_BILL_AUDIT_ERROR(214, "只能对状态为【申请中】的维修单进行审核"),
    REPAIR_QUALIFICATION_CHECK(215, "委外维修时，维修方和其资质文件不能为空"),


    REPAIR_BILL_FINISH_ERROR(216, "只能对状态为【已审核】的维修单进行完工"),
    REPAIR_BILL_ACCEPT_ERROR(217, "只能对状态为【已完工】的维修单进行验收"),

    REPAIR_BILL_SETTLE_ERROR(218, "只能对状态为【已验收】的维修单进行结算"),
    REPAIR_BILL_TIME_ERROR(219, "维修开始时间不能小于结束时间"),
    //维修单----end

    //safeInspectPlan----start
    PLAN_DATE_IS_BEFORE_TODAY(220, "计划开始日期不能小于今天"),
    //safeInspectPlan----end

    DELETE_FAILED(8888, "无法删除"),
    COLLECTION_IS_EMPTY(8889, "至少选择一条"),
    EXCEL_ERROR(8890, "Excel操作异常"),

    BIZ_ERROR(1, "业务异常"),
    SYSTEM_ERROR(9999, "系统错误");

    BizCode(Integer code, String comment) {
        this.code = code;
        this.comment = comment;
    }

    private final Integer code;

    private final String comment;
}
